<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="UTF-8" />
    <title>Menu - Focus Trap</title>
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"
    />
    <link href="../../../../../css/ionic.bundle.css" rel="stylesheet" />
    <link href="../../../../../scripts/testing/styles.css" rel="stylesheet" />
    <script src="../../../../../scripts/testing/scripts.js"></script>
    <script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script>
  </head>
  <body>
    <ion-app>
      <ion-menu content-id="main" id="menu">
        <ion-header>
          <ion-toolbar>
            <ion-title>Menu</ion-title>
          </ion-toolbar>
        </ion-header>
        <ion-content class="ion-padding">
          <ion-item>
            <ion-button id="open-modal-button">Open Modal</ion-button>
          </ion-item>
          <ion-modal id="modal-element" trigger="open-modal-button">
            <ion-content class="ion-padding">
              Modal content
              <ion-button onclick="dismissModal()">Dismiss Modal</ion-button>
              <ion-button id="other-button">Other Button</ion-button>
            </ion-content>
          </ion-modal>
        </ion-content>
      </ion-menu>

      <div class="ion-page" id="main">
        <ion-header>
          <ion-toolbar>
            <ion-title>Menu - Basic</ion-title>
          </ion-toolbar>
        </ion-header>
        <ion-content class="ion-padding">
          <ion-button onclick="openMenu()" id="open-menu-button">Open Menu</ion-button>
        </ion-content>
      </div>
    </ion-app>
    <script>
      const menu = document.querySelector('ion-menu');
      const modal = document.querySelector('ion-modal');
      const openMenu = () => {
        menu.open();
      };
      const dismissModal = () => {
        modal.dismiss();
      };
    </script>
  </body>
</html>
